using UnityEngine;
using UnityEngine.UI;
using Voodoo.Distribution;

public class Translation : MonoBehaviour
{
	private string _lKode;

	[SerializeField]
	private Font _baseFont;

	[SerializeField]
	private Font _rusFont;

	[Space]
	[SerializeField]
	private Text[] Generic_NoThanks;

	[SerializeField]
	private Text[] Generic_Play;

	[SerializeField]
	private Text[] Generic_Back;

	[SerializeField]
	private Text[] Generic_OutOfFuel;

	[SerializeField]
	private Text[] Generic_LevelCompleted;

	[SerializeField]
	private Text[] Generic_Free;

	[SerializeField]
	private Text[] Generic_Skins;

	[SerializeField]
	private Text[] Generic_Upgrades;

	[SerializeField]
	private Text[] Generic_Max;

	[SerializeField]
	private Text[] Generic_Unlocked;

	[SerializeField]
	private Text[] Generic_New;

	[SerializeField]
	private Text[] Generic_FillTank;

	[Space]
	[SerializeField]
	private Text[] NoInternetPopup;

	[Space]
	[SerializeField]
	private Text[] Options_PrivacyPolicy;

	[SerializeField]
	private Text[] Options_Restore;

	[SerializeField]
	private Text[] Options_RestoreFailed;

	[SerializeField]
	private Text[] Options_RestoreSuccess;

	[Space]
	[SerializeField]
	private Text[] Noads_Header;

	[SerializeField]
	private Text[] Noads_Explanation;

	[SerializeField]
	private Text[] Noads_ThankYou;

	[SerializeField]
	private Text[] Noads_Buy;

	[Space]
	[SerializeField]
	private Text[] Increment_Length;

	[SerializeField]
	private Text[] Increment_Fuel;

	[SerializeField]
	private Text[] Increment_Power;

	[SerializeField]
	private Text[] Increment_Size;

	[Space]
	[SerializeField]
	private Text[] RocketLauncher;

	[Space]
	[SerializeField]
	private Text[] BonusLevel_Header;

	[SerializeField]
	private Text[] BonusLevel_Go;

	[SerializeField]
	private Text[] BonusLevel_Description;

	[Space]
	[SerializeField]
	private Text[] SkinUnlockedPopup_Header;

	[SerializeField]
	private Text[] SkinUnlockedPopup_Select;

	[SerializeField]
	private Text[] CashBoost;

	[SerializeField]
	private Text[] DrillBoost;

	[Space]
	[SerializeField]
	private Text[] Generic_Ok;

	[SerializeField]
	private Image[] _noads;

	[SerializeField]
	private Sprite[] _NoAdsSprites;

	private void Start()
	{
		_lKode = Localization.LanguageCode;
		Translate(Generic_NoThanks, "Generic_NoThanks");
		Translate(Generic_Play, "Generic_Play");
		Translate(Generic_Back, "Generic_Back");
		Translate(Generic_OutOfFuel, "Generic_OutOfFuel");
		Translate(Generic_LevelCompleted, "Generic_LevelCompleted");
		Translate(Generic_Free, "Generic_Free");
		Translate(Generic_Skins, "Generic_Skins");
		Translate(Generic_Upgrades, "Generic_Upgrades");
		Translate(Generic_Max, "Generic_Max");
		Translate(Generic_Unlocked, "Generic_Unlocked");
		Translate(Generic_New, "Generic_New");
		Translate(Generic_FillTank, "Generic_FillTank");
		Translate(NoInternetPopup, "NoInternetPopup");
		Translate(Options_PrivacyPolicy, "Options_PrivacyPolicy");
		Translate(Options_Restore, "Options_Restore");
		Translate(Options_RestoreFailed, "Options_RestoreFailed");
		Translate(Options_RestoreSuccess, "Options_RestoreSuccess");
		Translate(Noads_Header, "Noads_Header");
		Translate(Noads_Explanation, "Noads_Explanation");
		Translate(Noads_ThankYou, "Noads_ThankYou");
		Translate(Noads_Buy, "Noads_Buy");
		Translate(Increment_Length, "Increment_Length");
		Translate(Increment_Fuel, "Increment_Fuel");
		Translate(Increment_Power, "Increment_Power");
		Translate(Increment_Size, "Increment_Size");
		Translate(RocketLauncher, "RocketLauncher");
		Translate(BonusLevel_Header, "BonusLevel_Header");
		Translate(BonusLevel_Go, "BonusLevel_Go");
		Translate(BonusLevel_Description, "BonusLevel_Description");
		Translate(SkinUnlockedPopup_Header, "SkinUnlockedPopup_Header");
		Translate(SkinUnlockedPopup_Select, "SkinUnlockedPopup_Select");
		Translate(CashBoost, "CashBoost");
		Translate(DrillBoost, "DrillBoost");
		Translate(Generic_Ok, "Generic_Ok");
		for (int i = 0; i < _noads.Length; i++)
		{
			for (int j = 0; j < _NoAdsSprites.Length; j++)
			{
				if (_NoAdsSprites[j].name == _lKode)
				{
					_noads[i].sprite = _NoAdsSprites[j];
					break;
				}
			}
		}
	}

	private void Translate(Text[] t, string key)
	{
		for (int i = 0; i < t.Length; i++)
		{
			t[i].text = Localization.GetTranslation(key);
			t[i].font = ((_lKode == "RU") ? _rusFont : _baseFont);
		}
	}
}
